<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<jsp:include page="checkAdmin.jsp" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 <link href="css/paper.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="js/jquery-2.0.js"></script>
<script type="text/javascript">
$(function(){
	
	$(window).resize(function(){
			var left =  $("#main").offset().left+$("#main").width();
			$("#answerCard").css("left",left+20);
	});
	$(".btn").click(function(){
		window.opener=null;
		window.close();
	});
});	


//跳转到指定锚点
function jump(current) {
    $("html, body").animate({
      scrollTop: ($($(current).attr("href")).offset().top-30) + "px"
    }, {
      duration: 500,
      easing: "swing"
    });
    return false;
};


</script>
<style>
	#showScore{
	 width:200px;
	 height:300px;
	 padding: 10px 50px;
	}
	#showScore h2{
		text-align: center;
		font-size:25px;
		color:#333;
		font-family: 新宋体;
	}
	#showScore ul{
		
	}
	#showScore ul li{
		border-bottom:1px solid #ccc;
		height:30px;
		line-height: 30px;
		font-size:16px;
	}
	#showScore ul li b{
		font-size:16px;
	}
	#showScore p {
		margin:10px 0 0 70px ;
		line-height:50px;
	}
	#showScore p img {
	  float:left;
	  border:none;
	  margin-right:10px;
	}
	#showScore p span{
		font-size:15px;
	}
	
	.answerInfo p{
		font-weight: bold;
		text-indent: 10px;
		padding: 5px 0;
		font-size: 13px;
	}
	
	.answerInfo div{
	   min-height: 30px;
	   line-height: 22px;
	   padding: 5px 20px;
	   background: #eee;
	   text-indent: 2em;
	}
</style>
</head>


<body style="background-color:#1c77ac; background-image:url(images/light.png); background-repeat:no-repeat; ">
<span id="lastTime" style="display:none"></span>
    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  

<div class="paperTop">    
    <span>欢迎使用在线考试系统--错题分析</span>    
    <ul>
    <li>当前考生 : [ <b id="s_name">${student.stu_name }</b> ]</li>
    <li>学号 : [ <b id="s_id">${student.stu_id }</b> ]</li>
    </ul>    
</div>

<div id="main">
	<div class="paperInfo">
		<h1>${paperName } （只显示错题）</h1>
		<ul>
			<li>
				<p>本试卷共有</p>
				<p><b>--</b>题</p>
			</li>
			<li>
				<p>卷面总分	</p>			
				<p><b  id="p_total">--</b>分</p>
			</li>
			<li>
				<p>答题时间</p>
				<p><b id="p_time">--</b>分钟</p>
			</li>
			<li style="border:none">
				<p>试卷来源</p>
				<p>exam在线考试系统</p>
			</li>
			

		</ul>
	</div>

	<div class="type">
		<h5>以下为 考生  [${student.stu_name } ] 所有的错题</h5>
		一、单项选择题
	</div>
	 <s:if test="#request.Question!=null">
        <s:iterator value="#request.Question" status="list" id="question" var="qfm">
		<span id="m<s:property value="id"/>"></span>
		<dl class="question"  >
			<dd>
			<input type="hidden" name="qids" value="<s:property value="id"/>"/>
			<input type="hidden" name="myAnswer" value="X"/>
			
			</dd>
			<dt><b>${list.index+1 }、</b>
			<s:property value="content"/>
			<s:property value="option[i]"/>
			</dt>
			<s:iterator value="option" status="opt">
				<dd class="option dd_${list.index }"  onclick="selOption(this)"><label>
					
				<s:if test="#opt.index==0">
				 <input type="radio" name="a${list.index }" value="A" disabled/> A
				</s:if>
				<s:elseif test="#opt.index==1">
				<input type="radio" name="a${list.index }" value="B" disabled/> B
				</s:elseif>
				<s:elseif test="#opt.index==2">
				<input type="radio" name="a${list.index }" value="C" disabled/> C
				</s:elseif>
				<s:else>
				<input type="radio" name="a${list.index }" value="D" disabled/> D
				</s:else>
				、<s:property /></label>
				</dd>
			</s:iterator>
			<dd class="answerInfo">
			  <p>答案解析:<b style="float: right;color:red;padding-right:20px">正确答案 : <i id="aa_${list.index }">${answer }</i></b></p>
			   <script>
			   		var salisa = $(".dd_${list.index } ").find("input");
			   		var answer = $("#aa_${list.index }").html();
			   		for(var i=0;i<salisa.length;i++){
				   		if(salisa[i].value==answer){
				   		    $(salisa[i]).attr("checked",true);
				   			$(salisa[i]).parent().parent().addClass("selopt");
				   		}
			   		}
			   </script>
			   <div>
			   <s:if test="answer_info!=''">
			     ${answer_info }
			   </s:if>
			   <s:else>
			              此题暂无答案解析
			   </s:else>
			   </div>
			</dd>
		</dl>
	</s:iterator>
	</s:if>
</div>


	<div id="answerCard">
		<div class="time">
		
		<img src="images/clock.png"/>
		<div class="time-item" style="margin-left:10px">
			<strong id="hour_show">0时</strong>
			<strong id="minute_show">0分</strong>
			<strong id="second_show">0秒</strong>
		</div>
		</div>
		<div class="card">
			<s:if test="#request.Question!=null">
        	<s:iterator value="#request.Question" status="list" >
				<s:if test="#list.index+1<10">
				<a href="#m<s:property value="id"/>" id="a${list.index }" onclick="return jump(this)" class="selected">0${list.index+1 }</a>
				</s:if>
				<s:else>
				<a href="#m<s:property value="id"/>" id="a${list.index }" onclick="return jump(this)" class="selected">${list.index+1 }</a>
				</s:else>
			</s:iterator>
			</s:if>
		</div>
		<div class="submitTest">
			<p> <input type="button" class="btn" value="关闭本页"/></p>
		</div>
	</div>
</body>
</html>
